package com.main;

import javax.swing.*;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;


/**
 * @author Erik Stell
 * @version 1.0
 */
public class WriterTools extends JFrame {

    /**
     * @throws HeadlessException
     */
    private WriterTools() throws HeadlessException {
        super("Writer Tools");
        JMenuBar menu = new JMenuBar();
        menu.setVisible(true);
        JMenu mine = new JMenu("mine");
        mine.setVisible(true);
        mine.add("option1");
        mine.add("option2");
        mine.add("option3");

        setJMenuBar(menu);
        //set look and feel
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }

        this.setResizable(false);

        addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });

        MainInterfaceBinding thisPanel = new MainInterfaceBinding();
        this.setContentPane(thisPanel.getPnlMainPanel());

    }

    public static void main(String[] args) {
        WriterTools window = new WriterTools();
        window.pack();
        //setResizable(false);
        int locationx = ((Toolkit.getDefaultToolkit().getScreenSize().width / 2));
        int windowWidth = (window.getWidth() / 2);
        int locationy = ((Toolkit.getDefaultToolkit().getScreenSize().height / 2));
        int windowHeight = (window.getHeight() / 2);

        window.setLocation(((Toolkit.getDefaultToolkit().getScreenSize().width / 2) -
                (window.getWidth() / 2)),
                ((Toolkit.getDefaultToolkit().getScreenSize().height / 2) -
                        (window.getHeight() / 2)));
        window.setVisible(true);
    }
}